<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改余额')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-balance-change">
            <input type="hidden" name="userId" th:value="${userId}">
            <div class="form-group">
                <label class="col-sm-3 control-label">当前余额：</label>
                <div class="col-sm-8 text-info">
                    [[${balance}]]元
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">充值类型：</label>
                <div class="col-sm-8">
                    <select name="changeBalanceType" class="form-control m-b" th:with="type=${@dict.getType('sd_changebalance_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">充值金额：</label>
                <div class="col-sm-8">
                    <input name="money" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        let prefix = ctx + "system/user";
        $("#form-balance-change").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/changeBalance", $('#form-balance-change').serialize());
            }
        }
    </script>
</body>
</html>